fn main() {
    let _a : i32 = 5;
    print9x9();
    println!("Square root of 3 is {}", square_root(3_f32));
}

fn square_root(a :f32) -> f32 {
    let e :f32 = 1e-6;
    let mut out :f32 = 1.0;
    loop {
        if (out * out - a).abs() <= e {
            break
        }
        out = (a / out + out) / 2.0;
    }
    out
}

fn print9x9() {

    for i in 1..10 {
        for j in 1..10 {
            if j > i {
                continue;
            }
            print!("{} * {} = {}\t", i, j, i * j);
        }
        println!("")
    }
}
